import instance from './index';
import qs from 'qs';

const preUrlPath = '';
//发送手机验证码
const sendVerify = {
  p: ['get,/accounts'],
  r: params => {
    return instance.get(`/v1/common/sendVaildateCode`, {params})
  }
};
//验证手机号是否注册过
const validMobileReg = {
  p: ['get,/accounts'],
  r: params => {
    return instance.get(`/v1/user/checkMobileIsRegistry`, {params})
  }
};
//用户注册
const register = {
  p: ['get,/accounts'],
  r: params => {
     return instance.post(`/v1/user/registry`, qs.stringify(params),{ headers:{'Content-Type':'application/x-www-form-urlencoded'}}).catch(function(res){
      console.log(res)
    })
  }
}
//用户找回密码
const findpassword = {
  p: ['get,/accounts'],
  r: params => {
     return instance.post(`/v1/user/findPassword`, qs.stringify(params),{ headers:{'Content-Type':'application/x-www-form-urlencoded'}}).catch(function(res){
      console.log(res)
    })
  }
}
//用户找回资金密码
const findPayPassword = {
  p: ['get,/accounts'],
  r: params => {
     return instance.post(`/v1/user/findPayPassword`, qs.stringify(params),{ headers:{'Content-Type':'application/x-www-form-urlencoded'}}).catch(function(res){
      console.log(res)
    })
  }
}
export {
 sendVerify,
 register,
 validMobileReg,
 findpassword,
 findPayPassword
}
